<div id="pad-wrapper" class="new-user">
	<div class="row-fluid header">
		<h3>创建</h3>
	</div>
	<div class="row-fluid form-wrapper">
		<!-- left column -->
		<div class="span9 with-sidebar">
			<div class="container">
				<form class="new_user_form form-horizontal" action="/marquee/save" method="post" id="dataForm" enctype="multipart/form-data">
					<div class="field-box"></div>
					<div class="control-group form-group span12">
						<label class="control-label" for="banner_name">分类:</label>
						<div class="controls col-lg-5">
							<select name="block_id" id="block_id">
								<option>--请选择--</option>
								<?php foreach ($block_list as $block):?>
								<option value="<?php echo $block['block_id']?>"><?php echo $block['block_name']?></option>
								<?php endforeach;?>
							</select>
						</div>
					</div>
					<div class="control-group form-group span12">
						<label class="control-label" for="banner_name">描述:</label>
						<div class="controls col-lg-5">
							<input type="text" class="form-control" id="description" name="description" placeholder="描述"/>
						</div>
					</div>
					<div class="control-group form-group span12">
						<label class="control-label" for="link">跳转连接:</label>
						<div class="controls col-lg-5">
							<input type="text" class="form-control span8" name="link" placeholder="http://"/>
						</div>
					</div>
					<div class="control-group form-group span12">
						<label class="control-label" for="image">图片:</label>
						<div class="controls col-lg-5">
							<input class="form-control" type="file" accept="image/jpg,image/jpeg,image/png" name="image"/>
						</div>
					</div>
					<div class="span12 field-box"></div>
					<div class="control-group form-group span12 actions">
						<label class="control-label" for="" class="control-label"></label>
						<div class="controls col-lg-5">
							<input type="submit" class="btn-glow primary" value="提交" />
						</div>
					</div>
				</form>
			</div>
		</div>
		<!-- side right column -->
		<div class="span3 form-sidebar pull-right">
		</div>
	</div>	
	<script type="text/javascript">
	$(document).ready(function() {
		$('#dataForm').bootstrapValidator({
			message: 'This value is not valid',
			feedbackIcons: {
				valid: 'glyphicon glyphicon-ok',
				invalid: 'glyphicon glyphicon-remove',
				validating: 'glyphicon glyphicon-refresh'
			},
			fields: {
				block_id: {
					message: '分类不符合规则',
					validators: {
						notEmpty: {
							message: '分类是必填项，不能为空'
						},
						regexp: {
							regexp: /\d/,
							message: '请选择分类'
						}
					}
				},
				description: {
					message: '描述不符合规则',
					validators: {
						notEmpty: {
							message: '描述是必填项，不能为空'
						}
					}
				},
				image: {
					message: '图片不符合规则',
					validators: {
						notEmpty: {
							message: ' 请选择一张图片'
						}
					}
				}
			}
		});
	});
	</script>
</div>


